package chapter07

import scala.collection.immutable.Queue
import scala.collection.mutable

/**
 *
 * @author cdhuangchao3
 * @date 2023/6/11 2:42 PM
 */
object Test19_Queue {
  def main(args: Array[String]): Unit = {
    // 1.创建可变队列
    val queue: mutable.Queue[String] = mutable.Queue[String]()

    queue.enqueue("a", "b", "c")
    println(queue)
    println(queue.dequeue())
    println(queue)
    println(queue.dequeue())
    println(queue)

    queue.enqueue("d", "e")

    println(queue)
    println(queue.dequeue())
    println(queue)

    println("="*20)

    val queue2 = Queue("a", "b", "c")
    val queue3 = queue2.enqueue("d")
    println(queue2)
    println(queue3)
    val queue4: (String, Queue[String]) = queue2.dequeue
    println(queue4)
  }
}
